"""
 向文件中写出内容
    字符数 = 对象名.write(字符串)
"""

from pathlib import Path

with open('file/data.txt','a',encoding='utf-8') as f:
    # f.write('床前明月光')
    f.write('唐李白\n')